<header>
	<h3><?= lang('product_manage') ?> <span>- <?= lang('product_create') ?></span></h3>
</header>
<section class="welly">
	<form id="create_product" method="post"	action="" class="form-horizontal" enctype="multipart/form-data">
		<input type="hidden" name="submit" value="1"/>
		<ul class="nav nav-tabs tab_styled_light">
			<li class="active"><a href="#tab1" data-toggle="tab"><?= lang('product_data') ?></a></li>
			<li><a href="#tab2" data-toggle="tab"><?= lang('product_info') ?></a></li>
			<li><a href="#tab3" data-toggle="tab"><?= lang('product_images') ?></a></li>
			<li><a href="#tab4" data-toggle="tab"><?= lang('product_catalogue') ?></a></li>
			<li><a href="#tab5" data-toggle="tab"><?= lang('product_location') ?></a></li>
			<li><a href="#tab6" data-toggle="tab"><?= lang('product_discount') ?></a></li>
		</ul>
		<div class="tab-content tab_content_light">
			<div id="tab1" class="tab-pane active">
				<div class="control-group">
					<label class="control-label"><?= lang('product_image') ?></label>
					<div class="controls">
						<input type="file" name="image" class="input-xlarges"/>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?= lang('product_price') ?></label>
					<div class="controls">
						<input type="text" name="price" class="input-medium"/>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?= lang('product_sale_price') ?></label>
					<div class="controls">
						<input type="text" name="sale_price" class="input-medium"/>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?= lang('product_start') ?></label>
					<div class="controls">
						<input type="text" name="start" class="input-medium"/>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?= lang('product_end') ?></label>
					<div class="controls">
						<input type="text" name="end" class="input-medium"/>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?= lang('product_amount') ?></label>
					<div class="controls">
						<input type="text" name="amount" class="input-medium"/>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label"><?= lang('product_voucher') ?></label>
					<div class="controls">
						<input type="checkbox" name="voucher" value="1" <?=isset($form_data['voucher'])?($form_data['voucher']==1?'checked':''):''?> class="input-medium"/>
					</div>
				</div>
			</div>
			<div id="tab2" class="tab-pane fade">
				<ul class="nav nav-tabs tab_styled_light">
					<? foreach ($langs as $l) { ?>
						<li<?= $l->id == $lang ? ' class="active"' : '' ?>><a href="#tab2<?= $l->id ?>" data-toggle="tab"><?= $l->name ?></a></li>
					<? } ?>
				</ul>
				<div class="tab-content tab_content_light">
					<? foreach ($langs as $l) { ?>
						<div id="tab2<?= $l->id ?>" class="tab-pane<?= $l->id == $lang ? ' active' : ' fade' ?>">
							<div class="control-group">
								<label class="control-label"><?= lang('product_name') ?></label>
								<div class="controls">
									<input type="text" name="info[<?= $l->id ?>][name]" class="input-xlarge" />
								</div>
							</div>
							<div class="control-group">
								<label class="control-label"><?= lang('product_description') ?></label>
								<div class="controls">
									<textarea id ="description<?= $l->id ?>" name="info[<?= $l->id ?>][description]" class="input-xlarge" ></textarea>
									<script type="text/javascript">
										init_ckeditor('description<?= $l->id ?>')
									</script>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label"><?= lang('product_advantages') ?></label>
								<div class="controls">
									<textarea id="advantages<?= $l->id ?>" name="info[<?= $l->id ?>][advantages]" class="input-xlarge" ></textarea>
									<script type="text/javascript">
										init_ckeditor('advantages<?= $l->id ?>');
									</script>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label"><?= lang('product_meta_desc') ?></label>
								<div class="controls">
									<textarea name="info[<?= $l->id ?>][meta_desc]" class="input-xlarge" ></textarea>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label"><?= lang('product_meta_keyword') ?></label>
								<div class="controls">
									<textarea name="info[<?= $l->id ?>][meta_keyword]" class="input-xlarge" ></textarea>
								</div>
							</div>
						</div>
					<? } ?>
				</div>
			</div>
			<div id="tab3" class="tab-pane fade">
				<div class="control-group">
					<label class="control-label" for="images"><?= lang('product_images') ?></label>
					<div id="images" class="controls">
						<div>
							<input type="file" name="images_0" class="input-xlarges"/>
						</div>
					</div>
				</div>
				<div class="form-actions">
					<input type="button" value="<?=lang('product_add_image')?>" class="btn btn-info" id="add_image" />
				</div>
			</div>
			<div id="tab4" class="tab-pane fade">
				<label class="checkbox"><input type="checkbox" id="tab4_check"><b><?=lang('select_all')?></b></label>
				<?foreach($catalogues as $catalogue){?>
				<label class="checkbox">
					<input type="checkbox" value="<?=$catalogue->id?>" name="catalogues[]" /><?=$catalogue->pre?><?=$catalogue->name?>
				</label>
				<?}?>
			</div>
			<div id="tab5" class="tab-pane fade">
				<label class="checkbox"><input type="checkbox" id="tab5_check"><b><?=lang('select_all')?></b></label>
				<?foreach($locations as $location){?>
				<label class="checkbox"><input type="checkbox" value="<?=$location->id?>" name="locations[]" /><?=$location->pre?><?=$location->name?></label>
				<?}?>
			</div>
			<div id="tab6" class="tab-pane fade">

			</div>
		</div>
		<hr>
		<div>
			<input type="submit" class="btn btn-success" />
			<button class="btn"><?= lang('cancel') ?></button>
		</div>
	</form>
</section>